{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>提现记录</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->
            <div class="row">
                <div class="col-sm-12">
                    <form name="admin_list_sea" class="layui-form" method="post" action="">
                        <div class="col-sm-3">
                            <div class="input-group">
                                <input type="text" id="key" class="form-control" name="account" value=""
                                       placeholder="输入需查询的会员账号"/>
                                <span class="input-group-btn"> 
                                    <button type="submit" class="btn btn-primary"><i
                                            class="fa fa-search"></i> 搜索</button>
                                </span>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <!--搜索框结束-->
            <div class="example-wrap">
                <div class="example">

                    <table class="layui-table"
                           lay-data="{id:'withdrawals',url:'withdrawals_log',height:'full-210',cellMinWidth:100,page:true,limit:10,text:{none:'暂无相关数据'}}"
                           lay-filter="withdrawals">
                        <thead>
                        <tr>
                            <th lay-data="{field:'id', title:'ID', width:50, align:'center', rowspan:2, fixed:true}"></th>
                            <th lay-data="{field:'account', title:'会员', align:'center', rowspan:2, fixed:true}"></th>
                            <th lay-data="{field:'money', title:'提现金额', align:'center', rowspan:2,sort:true}"></th>
                            <th lay-data="{field:'charge', title:'手续费', align:'center', rowspan:2,sort:true}"></th>
                            <th lay-data="{field:'arrival', title:'实际到账', align:'center', rowspan:2,sort:true}"></th>
                            <th lay-data="{field:'status', title:'状态', align:'center', rowspan:2,templet:'#status'}"></th>
                            <th lay-data="{title:'收款信息', align:'center', colspan:3}"></th>
                            <th lay-data="{field:'create_time', title:'申请时间', width:180, align:'center', rowspan:2,sort:true}"></th>
                        </tr>
                        <tr>
                            <th lay-data="{field:'name', title:'收款人', align:'center'}"></th>
                            <th lay-data="{field:'bank', title:'收款银行', width:120, align:'center'}"></th>
                            <th lay-data="{field:'bank_card', title:'银行账号', width:200, align:'center'}"></th>
                        </tr>
                        </thead>
                    </table>
                    <script type="text/html" id="status">
                        {{# if(d.status ==1){ }}
                        <font color="green">完成打款</font>
                        {{# }else if(d.status ==3){ }}
                        <font color="red">打款失败</font>
                        {{# } }}
                    </script>
                </div>
            </div>
            <!-- End Example Pagination -->
        </div>
    </div>
</div>
<!-- End Panel Other -->

<!-- 加载动画 -->
<div class="spiner-example">
    <div class="sk-spinner sk-spinner-three-bounce">
        <div class="sk-bounce1"></div>
        <div class="sk-bounce2"></div>
        <div class="sk-bounce3"></div>
    </div>
</div>

{include file="public/footer" /}

<script type="text/javascript">
    $(".spiner-example").css('display', 'none'); //数据加载完关闭动画

    var table = layui.table,form = layui.form;
    /**
     * 搜索
     */
    form.on('submit(search)',function (data) {
        var data = data.field;
        if(!data.account){
            layer.msg('请输入会员账号',{time:1500});
            return false;
        }
        table.reload('withdrawals', {
            where: {
                account:data.account
            }
        });
        return false;
    });

    /**
     * 排序
     */
    table.on('sort(withdrawals)', function (obj) {
        table.reload('withdrawals', {
            initSort: obj, //记录初始排序，如果不设的话，将无法标记表头的排序状态。 layui 2.1.1 新增参数
            where: {
                field: obj.field, //排序字段
                order: obj.type //排序方式
            }
        });
    });
</script>
</body>
</html>